import type { AxiosRequestConfig, AxiosResponse } from 'axios'

export interface glInterceptors<T = AxiosResponse> {
  requestInterceptors?: (config: AxiosRequestConfig) => AxiosRequestConfig
  requestInterceptorsCatch?: (err: any) => any
  responseInterceptors?: (res: T) => T
  responseInterceptorsCatch?: (err: any) => any
}

export interface AxiosRequestConfigExtends<T = AxiosResponse>
  extends AxiosRequestConfig {
  interceptors?: glInterceptors<T>
  showLoading?: boolean
}

export interface IUserInfo {
  name: string,
  password: string
}

export interface IData {
	id: number;
	name: string;
	token: string;
}



export interface Role {
	id: number;
	name: string;
	intro: string;
	createAt: string;
	updateAt: string;
}

export interface Department {
	id: number;
	name: string;
	parentId?: any;
	createAt: string;
	updateAt: string;
	leader: string;
}

export interface Data {
	id: number;
	name: string;
	realname: string;
	cellphone: number;
	enable: number;
	createAt: string;
	updateAt: string;
	role: Role;
	department: Department;
}


export interface RootObject<T = any> {
	code: number;
	data: T;
}
